/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package objects;

import graphic.Graphic;

/**
 *
 * @author Marcin
 */
public class SRect {
    public float x1,x2,y1,y2;
    public boolean background=false;
    public boolean in(float x, float y){
        return(x>x1 && x<x2 && y>y1 && y<y2);
    }
    public void set(float nx1,float nx2,float ny1, float ny2){
        if(nx2>nx1){
            x1=nx1;
            x2=nx2;
        }else{
            x1=nx2;
            x2=nx1;
        }
        if(ny2>ny1){
            y1=ny1;
            y2=ny2;            
        }else{
            y1=ny2;
            y2=ny1;
        }
    }
    public void draw2d(){
        Graphic.e.draw2dRect(this,background);
    }
    public void draw(){
        Graphic.e.drawRect(this);
    }
}
